home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWMaping.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.0 KB  |  153 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWMaping.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #if defined(FW_PROFILER_CALLS) && defined(__MWERKS__)
  13. #pragma profile on
  14. #endif
  15.  
  16. #ifndef FWMAPING_H
  17. #include "FWMaping.h"
  18. #endif
  19.  
  20. #ifndef FWGRUTIL_H
  21. #include "FWGrUtil.h"
  22. #endif
  23.  
  24. #ifndef SLGRGLOB_H
  25. #include "SLGrGlob.h"
  26. #endif
  27.  
  28. #ifndef FWODMISC_H
  29. #include "FWODMisc.h"
  30. #endif
  31.  
  32. #ifndef FWGRUTIL_H
  33. #include "FWGrUtil.h"
  34. #endif
  35.  
  36. #ifndef SLREGION_H
  37. #include "SLRegion.h"
  38. #endif
  39.  
  40. #ifndef FWSOMENV_H
  41. #include "FWSOMEnv.h"
  42. #endif
  43.  
  44. // ----- OpenDoc Includes -----
  45.  
  46. #ifndef SOM_ODTransform_xh
  47. #include <Trnsform.xh>
  48. #endif
  49.  
  50. #ifndef SOM_ODShape_xh
  51. #include <Shape.xh>
  52. #endif
  53.  
  54. //========================================================================================
  55. //    RunTime Info
  56. //========================================================================================
  57.  
  58. #ifdef FW_BUILD_MAC
  59. #pragma segment FWGraphics_Mapping
  60. #endif
  61.  
  62. //========================================================================================
  63. //    class FW_CMapping
  64. //========================================================================================
  65.  
  66. FW_DEFINE_AUTO(FW_CMapping)
  67.  
  68. //----------------------------------------------------------------------------------------
  69. //    FW_CMapping::FW_CMapping
  70. //----------------------------------------------------------------------------------------
  71.  
  72. FW_CMapping::FW_CMapping(FW_EMappingModes mappingMode)
  73. {
  74.     FW_PrivMapping_Init(*this, mappingMode);
  75.     FW_END_CONSTRUCTOR
  76. }
  77.  
  78. //----------------------------------------------------------------------------------------
  79. //    FW_CMapping::FW_CMapping
  80. //----------------------------------------------------------------------------------------
  81.  
  82. FW_CMapping::FW_CMapping(const FW_CMapping& mapping)
  83. {
  84.     FW_PrivMapping_InitFromCopy(*this, mapping);
  85.     FW_END_CONSTRUCTOR
  86. }
  87.  
  88. //----------------------------------------------------------------------------------------
  89. //    FW_CMapping::FW_CMapping
  90. //----------------------------------------------------------------------------------------
  91.  
  92. FW_CMapping::FW_CMapping(const FW_SMapping& sMapping)
  93. {
  94.     FW_PrivMapping_InitFromCopy(*this, sMapping);
  95.     FW_END_CONSTRUCTOR
  96. }
  97.  
  98. //----------------------------------------------------------------------------------------
  99. //    FW_CMapping::~FW_CMapping
  100. //----------------------------------------------------------------------------------------
  101.  
  102. FW_CMapping::~FW_CMapping()
  103. {
  104.     FW_START_DESTRUCTOR
  105.     FW_SOMEnvironment ev;
  106.     FW_PrivMapping_Term(*this, ev);
  107. }
  108.  
  109. //----------------------------------------------------------------------------------------
  110. //    FW_CMapping::operator=
  111. //----------------------------------------------------------------------------------------
  112.  
  113. FW_CMapping& FW_CMapping::operator=(const FW_CMapping& mapping)
  114. {
  115.     if (&mapping != this)
  116.     {
  117.         FW_SOMEnvironment ev;
  118.         FW_PrivMapping_Term(*this, ev);
  119.         FW_PrivMapping_InitFromCopy(*this, mapping);
  120.     }
  121.  
  122.     return *this;
  123. }
  124.  
  125. //----------------------------------------------------------------------------------------
  126. //    FW_CMapping::operator=
  127. //----------------------------------------------------------------------------------------
  128.  
  129. FW_CMapping& FW_CMapping::operator=(const FW_SMapping& sMapping)
  130. {
  131.     if (&sMapping != this)
  132.     {
  133.         FW_SOMEnvironment ev;
  134.         FW_PrivMapping_Term(*this, ev);
  135.         FW_PrivMapping_InitFromCopy(*this, sMapping);
  136.     }
  137.  
  138.     return *this;
  139. }
  140.  
  141. //----------------------------------------------------------------------------------------
  142. //    FW_CMapping::operator==
  143. //----------------------------------------------------------------------------------------
  144.  
  145. FW_Boolean FW_CMapping::operator==(const FW_CMapping& mapping) const
  146. {
  147.     return (fMappingMode == mapping.fMappingMode &&
  148.             fLogicalExtent == mapping.fLogicalExtent &&
  149.             fDeviceExtent == mapping.fDeviceExtent && 
  150.             fDeviceOrg == mapping.fDeviceOrg &&
  151.             fLogicalOrg == mapping.fLogicalOrg);
  152. }
  153.